package com.sg.controller.pbff;

import com.sg.service.biz.pbff.TagService;
import com.sg.dto.biz.pbff.req.*;
import com.sg.dto.biz.pbff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Tag", tags = {"Tag"})
@RestController
// @RequestMapping("/poms/tag/")
public class TagController {
    @Autowired
    TagService tagService;

    /**
     * B1-1查询标签列表（平台）
     * gen by moon at 10/24/2022, 9:56:02 PM
     */
    @PostMapping("/oms/platform/tag/queryTagList")
    @ApiOperation(value = "B1-1查询标签列表（平台）", response = OkrResult.class)
    public OkrResult<BffQueryTagListRespDto> queryTagList(@RequestBody(required = false) @Validated BffQueryTagListReqDto reqDTO) {
        return OkrResult.success(tagService.queryTagList(reqDTO));
    }

    /**
     * B1-1修改标签（平台）
     * gen by moon at 10/24/2022, 9:56:04 PM
     */
    @PostMapping("/oms/platform/tag/updateTag")
    @ApiOperation(value = "B1-1修改标签（平台）", response = OkrResult.class)
    public OkrResult<BffUpdateTagRespDto> updateTag(@RequestBody(required = false) @Validated BffUpdateTagReqDto reqDTO) {
        return OkrResult.success(tagService.updateTag(reqDTO));
    }

    /**
     * B1-1新增标签（平台）
     * gen by moon at 10/24/2022, 9:56:03 PM
     */
    @PostMapping("/oms/platform/tag/addTag")
    @ApiOperation(value = "B1-1新增标签（平台）", response = OkrResult.class)
    public OkrResult<BffAddTagRespDto> addTag(@RequestBody(required = false) @Validated BffAddTagReqDto reqDTO) {
        return OkrResult.success(tagService.addTag(reqDTO));
    }

    /**
     * B1-1查询标签详情（平台）
     * gen by moon at 10/28/2022, 11:08:52 PM
     */
    @PostMapping("/oms/platform/tag/queryTagDetail")
    @ApiOperation(value = "B1-1查询标签详情（平台）", response = OkrResult.class)
    public OkrResult<BffQueryTagDetailRespDto> queryTagDetail(@RequestBody(required = false) @Validated BffQueryTagDetailReqDto reqDTO) {
        return OkrResult.success(tagService.queryTagDetail(reqDTO));
    }

    /**
     * B1-1删除标签(管理)
     * gen by moon at 11/23/2022, 10:44:08 PM
     */
    @PostMapping("/oms/platform/mgt/tag/deleteTag")
    @ApiOperation(value = "B1-1删除标签(管理)", response = OkrResult.class)
    public OkrResult<BffDeleteTagRespDto> deleteTag(@RequestBody(required = false) @Validated BffDeleteTagReqDto reqDTO) {
        return OkrResult.success(tagService.deleteTag(reqDTO));
    }

}

